<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- @input 输入会触发事件 -->
        <input type="text" :value="msg" @input="changeHandler">
        <p>{{ msg }}</p>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el:'#app',
            data() {
                return {
                    msg:"11"
                }
            },
            methods: {
                changeHandler(e) {
                    this.msg = e.target.value;
                }
            },
        })
    </script>
</body>
</html>